1. Field of the Invention
This invention relates to a variable length coding method intended to assign a different number of coding bits in accordance with the information content of a sample in converting an analog signal such as a television signal, etc. to a digital signal.
2. Description of Related Art
Most of the recent domestic digital video cassette recorders (referred to as a DVCR hereinafter) which are under development use a tape of 8 mm width. FIG. 1 illustrates a recording format of the DVCR conceivable from the present magnetic recording technique. Assuming that the length of a video track 21 of a tape 1 is approximately 62.4 mm, the width thereof is 6 .mu.m and the surface recording density is 2.2 .mu.m.sup.2 /bit, for example, in the case of recording using four recording heads while the drum is rotated at 3600 rpm, the recording bit-rate is approximately 41.27 Mbps. On the other hand, if a digital video signal is a signal of 4:2:2 component in compliance with CCIR, the recording bit-rate is about 216 Mbps. Therefore, it is considerably difficult to record the signal in real time on the tape of 8 mm width as it is inputted, and it becomes necessary to compress the inputted signal.
Meanwhile, a variable length coding method is considered as one method for compressing a signal. According to this coding method, when the analog signal is converted to a digital signal, a large number of coding bits are assigned to a sample having a large volume of information content, whereas a small number of coding bits is assigned to a sample having a small volume of information content. That is, a different number of coding bits is assigned corresponding to the roll,me of the information content. For example, an argument "ON ADAPTIVE DCT CODING TECHNIQUES FOR DIGITAL VIDEO RECORDING" (P.H.N.DE WITH and S.M.C. BORGERS, Philips) is revealed on IERE Proc. 7th Int. Conference on VIDEO, AUDIO and DATA RECORDING (Mar. 1988). An example of the variable length coding method is discussed therein, which reads as follows:
Each block of samples of size 8.times.8, for example, are considered, and correspondingly, the coefficients remaining after cosine transformation are denoted as F(u,v), where 0.ltoreq.u, v.ltoreq.7, The absolute address R of a coefficient is defined as the ranking number determined by the scanning function S of the coefficients (FIG. 2), thus R=S(u,v), 25 where 0.ltoreq.R.ltoreq.63. The coefficients are scanned before the coding starts and l coefficients (with R&gt;0) to be of non-zero amplitude are assumed. Correspondingly, a coefficient is uniquely determined by its amplitude F and its address R (ranking number after scanning).
Step 1 (full sort): Select coefficients with R&gt;0 and order them in an amplitude stack. For the k-th selected coefficient F.sub.k the following holds: EQU .vertline.F.sub.k (R.sub.k).vertline..gtoreq..vertline.F.sub.k+1 (R.sub.k+1).vertline.. . . , EQU .vertline.F.sub.k (R.sub.k).vertline.&gt;0(1.ltoreq.k.ltoreq.l)
The corresponding addresses R.sub.k are stored in an a stack. If .vertline.F.sub.j (R.sub.j).vertline.=.vertline.F.sub.k (R.sub.k).vertline.and R.sub.j &lt;R.sub.k, then j&lt;k.
Step 2 ( construct-difference signal ): Calculate the amplitude differences D.sub.k (R.sub.k) defined by: EQU D.sub.k (R.sub.k)=.vertline.F.sub.k-1 R(.sub.k-1).vertline.-.vertline.F.sub.k (R.sub.k).vertline., 2.ltoreq.k.ltoreq.l EQU D.sub.1 (R.sub.1)=.vertline.F.sub.1 (R.sub.1).vertline., k=1
This difference signal D.sub.k is a non-negative sequence for each block. The original amplitude signs sign(F.sub.k) are encoded separately. There are no changes in the address stack during this step.
Step 3 (address calculation): Recalculate from each address R.sub.k an address T.sub.k according to: EQU T.sub.k =R.sub.k -N.sub.k (1,R.sub.k), D.sub.k 22 0 EQU T.sub.k =R.sub.k -R.sub.k-1 -N.sub.k (R.sub.k-1,R.sub.k), D.sub.k =0
where N.sub.k (R.sub.1, R.sub.2) refers to the number of (previously encoded) coefficients Fj, 1.ltoreq.j.ltoreq.k-1 having R.sub.1 .ltoreq.R&lt;R.sub.2. The stack with amplitude differences is not changed during this step.
Step 4 (bit mapping): Coding of the sequence D.sub.k and the corresponding addresses T.sub.k for 1.ltoreq.k.ltoreq.l is performed here with two variable-length code tables, viz. VLC .sub.D (D.sub.k) and VLC.sub.T (T.sub.k). Furthermore, the DC coefficient F(0) is always transmitted as well as the sign of each selected coefficient F.sub.k. An example of a list of Huffman codewords for amplitudes and addresses is given in FIG. 3.
The DC coefficient F(0) is coded with some codeword C. The coding terminates with an EOB (End of Block) codeword since the number of coded coefficients may vary from block to block. In addition, the efficiency can be improved slightly by coding only the first coefficient with .vertline.F.sub.k .vertline.=1 and skipping all the codewords from VLC.sub.D related to equal-valued coefficients.
Since the conventional variable length coding method is performed as explained hereinabove, even if samples holding much information content or less information content in one block, the signals are successively coded one by one, regardless of the fact of the concentration, according to the method. As a result, the amount of data is not constant relative to the capacity of a recording medium, requiring some kind of manipulation such as suppression of the data which causes degradation of the image quality in reproducing the data.